
/***********************************************************************
 * Player class
 * 
 * Implements the player's ship artifact
 *
 * Signature:
 *  public static Player create (String name, Coord position, int energy);
 *  public void install ();
 *  public void destroy ();
 *  public Coord position ();
 *  public String name ();
 *  public void report (String message);
 *  public void changePosition (Coord target);
 *  public boolean isOrbitable ();
 *  public void takeDamage (int damage);
 *  public abstract char display ();
 *  public abstract String toString ();
 *  public int energy ();
 *  public void move (int dx, int dy) {
 ***********************************************************************/

public class Player extends Ship {

    protected Player (String n, Coord p, int e) {
	super(n,p,e);
    }

    public static Player create (String n, Coord p, int e) {
	Player sh = new Player(n,p,e);
	sh.install();
	return sh;
    }

    public void destroy () {
	super.destroy();
	System.exit(0);
    }

    public char display () {
	return '>';
    }

    public String toString () {
	return "Player " + this.name() + " " + this.position().toString() 
	    + " @ " + this.energy();
    }

    public void report (String s) {
	System.out.println(this.name() + " reports -- " + s);
    }

}
